<form class="layui-form" action="{:url('')}" method="post" id="editForm">
    {:FormExt::input('公告标题', 'title',isset($formData['title'])?$formData['title']:'' , '不能超过20个字', 'required', 'lay-verify="required"')}
    
    <div class="layui-form-item">
        <label class="layui-form-label">指定角色查阅</label>
        <div class="layui-input-block">
            {foreach name="roles" id="r" key="k"}
                <input type="checkbox" class="field-role_id" name="role_ids[]" value="{$k}" title="{$r}" {if (isset($formData['role_ids']) && in_array($k, $formData['role_ids']))}checked{/if} lay-skin="primary" />
            {/foreach}
        </div>
    </div>
    
    <div class="layui-form-item">
        <label class="layui-form-label">公告内容</label>
        <div class="layui-input-block" style="overflow:hidden;padding:0 10px 0 0">
            <textarea id="content" name="content" class="field-content">{if (isset($formData['content']))}{$formData['content']}{/if}</textarea>
        </div>
    </div>
   
    支持上传附件格式：.rar .zip .doc .docx .pdf ，单个文件不能超过20MB
    <div class="pop-bottom-bar">
    	<input type="hidden" class="field-id" value="{:isset($id)?$id:''}" name="id">
        <button type="submit" class="layui-btn layui-btn-normal" id="save" lay-submit="" lay-filter="formSubmit" hisi-data="{pop: true, refresh: true}">提交保存</button>
        <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
    </div>
</form>

{include file="system@block/layui" /}

<script>
    var formData = {:json_encode($formData)};
    layui.use(['form', 'func','layedit','jquery', 'laydate', 'upload'], function() {
         var $ = layui.jquery, laydate = layui.laydate, layer = layui.layer, upload = layui.upload;
        var $ = layui.jquery, form = layui.form;
        var layedit = layui.layedit;
        layui.func.assign(formData);
        
    });
</script>
{:editor(['content'])}